﻿{% extends "base.html" %}

{% block scripts %}
{% endblock %}

{% block content %}
    <h1>Настройки</h1>

    <div class="settings_block settings_block_important">

        <ul class="tabs_list settings_tabs">
            <li class="item"><a href="/settings/private/">Личное</a><span class="bg"></span></li>
            <li class="item"><a href="/settings/notify/">Оповещения</a><span class="bg"></span></li>
            <!--<li class="item"><a href="/settings/security/">Приватность</a><span class="bg"></span></li>-->
            <li class="item item_current"><a href="/settings/main/">Важное</a><span class="bg"></span></li>
        </ul>

        <form class="form" action="/change_password/" method="post">
            <h2 class="block_header">Смена пароля</h2>

            <dl>
                {% if error_message %}
                <dt><p class="error_message">{{ error_message }}</p></dt>
                {% endif %}
                {% if form.old_password.errors %}
                    <dt><p class="error_message">{{ form.old_password.errors|striptags }}</p></dt>
                {% endif %}
                <dt><label for="id_old_password">Старый пароль:</label></dt>
                <dd><input id="id_old_password" name="old_password" class="text_input" type="password"></dd>

                {% if form.non_field_errors %}
                    {% for error in form.non_field_errors %}
                        <dt><p class="error_message">{{ error|striptags }}</p></dt>
                    {% endfor %}
                {% endif %}
            
                {% if form.new_password1.errors %}
                    <dt><p class="error_message">{{ form.new_password1.errors|striptags }}</p></dt>
                {% endif %}
                <dt><label for="id_new_password1">Новый пароль:</label></dt>
                <dd><input id="id_new_password1" name="new_password1" class="text_input" type="password"></dd>

                {% if form.new_password2.errors %}
                    <dt><p class="error_message">{{ form.new_password2.errors|striptags }}</p></dt>
                {% endif %}
                <dt><label for="id_new_password2">Подтвердите пароль:</label></dt>
                <dd><input id="id_new_password2" name="new_password2" class="text_input" type="password"></dd>
            </dl>

            <div class="buttons"><input class="button" type="submit" value="Изменить"></div>
        </form>

        <form class="form" action="/change_email/" method="post">
            <h2 class="block_header">Смена почтового ящика</h2>

            <dl>
                <dt><label for="form_change_pass_old">Текущий адрес:</label></dt>
                <dd><span class="txt">{{ request.user.email }}</span></dd>

                {% if form.email.errors %}
                    <dt><p class="error_message">{{ form.email.errors|striptags }}</p></dt>
                {% endif %}
                <dt><label for="id_email">Новый адрес:</label></dt>
                <dd><input id="id_email" name="email" class="text_input" type="text"></dd>
            </dl>

            <div class="buttons"><input class="button" type="submit" value="Изменить"></div>
        </form>


        <!--
        <form class="form" action="#" method="post">
            <h2 class="block_header">Смена номера телефона</h2>

            <dl>
                <dt><label for="form_change_pass_old">Текущий номер:</label></dt>
                <dd><span class="txt">+792074533443</span></dd>
                <dt><label for="form_change_pass_new_1">Новый номер:</label></dt>
                <dd><input id="form_change_pass_new_1" class="text_input" type="text"></dd>
            </dl>

            <div class="buttons"><input class="button" type="submit" value="Изменить"></div>
        </form>
        -->


    </div>
{% endblock %}